/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gui;

import arquivos.Arquivos;
import javax.swing.JOptionPane;
import javax.swing.JTextField;
import ordenacao.BubbleSort;

/**
 *
 * @author Jorge
 */
public class JFrame_Fila extends javax.swing.JFrame {

    public JFrame_Fila() {
        initComponents();
    }
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        tf_fila = new javax.swing.JTextField();
        jLabel1 = new javax.swing.JLabel();
        bolha_fila = new javax.swing.JCheckBox();
        insertion_fila = new javax.swing.JCheckBox();
        selection_fila = new javax.swing.JCheckBox();
        quick_fila = new javax.swing.JCheckBox();
        jLabel2 = new javax.swing.JLabel();
        btn_salva_fila = new javax.swing.JToggleButton();
        btn_cancel_fila = new javax.swing.JToggleButton();
        jLabel3 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setAlwaysOnTop(true);
        setLocationByPlatform(true);
        setMinimumSize(new java.awt.Dimension(500, 500));
        setPreferredSize(new java.awt.Dimension(500, 500));
        getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jPanel1.setToolTipText("Teste");
        jPanel1.setPreferredSize(new java.awt.Dimension(1000, 600));

        tf_fila.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tf_filaActionPerformed(evt);
            }
        });

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
        jLabel1.setText("NOME DA ESTRUTURA");

        bolha_fila.setText("BubbleSort");
        bolha_fila.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bolha_filaActionPerformed(evt);
            }
        });

        insertion_fila.setText("InsertionSort");
        insertion_fila.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                insertion_filaActionPerformed(evt);
            }
        });

        selection_fila.setText("SelectionSort");
        selection_fila.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                selection_filaActionPerformed(evt);
            }
        });

        quick_fila.setText("QuickSort");
        quick_fila.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                quick_filaActionPerformed(evt);
            }
        });

        jLabel2.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
        jLabel2.setText("SELECIONAR MÉTODOS DE ORDENAÇÃO");

        btn_salva_fila.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        btn_salva_fila.setForeground(new java.awt.Color(0, 0, 255));
        btn_salva_fila.setText("SALVAR");
        btn_salva_fila.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_salva_filaActionPerformed(evt);
            }
        });

        btn_cancel_fila.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        btn_cancel_fila.setForeground(new java.awt.Color(255, 0, 0));
        btn_cancel_fila.setText("CANCELAR");
        btn_cancel_fila.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_cancel_filaActionPerformed(evt);
            }
        });

        jLabel3.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLabel3.setText("FILA");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(quick_fila)
                    .addComponent(jLabel2)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addGroup(jPanel1Layout.createSequentialGroup()
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(selection_fila)
                                .addComponent(insertion_fila)
                                .addComponent(bolha_fila))
                            .addGap(260, 260, 260))
                        .addGroup(jPanel1Layout.createSequentialGroup()
                            .addComponent(btn_salva_fila, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(39, 39, 39)
                            .addComponent(btn_cancel_fila, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addGap(29, 29, 29)
                        .addComponent(tf_fila, javax.swing.GroupLayout.PREFERRED_SIZE, 271, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(24, 24, 24))
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(202, 202, 202)
                .addComponent(jLabel3)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(20, 20, 20)
                .addComponent(jLabel3)
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(tf_fila, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel1))
                .addGap(37, 37, 37)
                .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(bolha_fila)
                .addGap(18, 18, 18)
                .addComponent(insertion_fila)
                .addGap(18, 18, 18)
                .addComponent(selection_fila)
                .addGap(26, 26, 26)
                .addComponent(quick_fila)
                .addGap(80, 80, 80)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btn_salva_fila, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btn_cancel_fila, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(57, Short.MAX_VALUE))
        );

        getContentPane().add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 11, 450, 500));

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void insertion_filaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_insertion_filaActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_insertion_filaActionPerformed

    private void btn_salva_filaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_salva_filaActionPerformed
        // TODO add your handling code here:
        Arquivos arquivo = null;
        String nomeDiretrio = tf_fila.getName();
        /*Inserir codigo aqui*/
        if(insertion_fila.isSelected()==true) // if check box is checked
       {
            arquivo.criarEstrutura(nomeDiretrio, "fila");
            arquivo.criarEstrutura(nomeDiretrio, "inserion_fila");
            arquivo.criarEstrutura(nomeDiretrio, "Celula");
            arquivo.criarEstrutura(nomeDiretrio, "Controle");
       }
        else{    // if check box unchecked 
            
        }
        // TODO add your handling code here:
        
    }//GEN-LAST:event_btn_salva_filaActionPerformed

    private void btn_cancel_filaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_cancel_filaActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_btn_cancel_filaActionPerformed

    private void selection_filaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_selection_filaActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_selection_filaActionPerformed

    private void bolha_filaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bolha_filaActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_bolha_filaActionPerformed

    private void quick_filaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_quick_filaActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_quick_filaActionPerformed

    private void tf_filaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tf_filaActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_tf_filaActionPerformed
    public static void main(String args[]) {
       try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Metal".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(JFrame_Fila.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(JFrame_Fila.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(JFrame_Fila.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(JFrame_Fila.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new JFrame_Fila().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JCheckBox bolha_fila;
    private javax.swing.JToggleButton btn_cancel_fila;
    private javax.swing.JToggleButton btn_salva_fila;
    private javax.swing.JCheckBox insertion_fila;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JCheckBox quick_fila;
    private javax.swing.JCheckBox selection_fila;
    private javax.swing.JTextField tf_fila;
    // End of variables declaration//GEN-END:variables
}
